<%--
  Created by IntelliJ IDEA.
  User: BYL
  Date: 2022/6/29
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        //切换验证码
        function refreshCode(){
            //1.获取验证码图片对象
            var vcode = document.getElementById("vcode");

            //2.设置其src属性，加时间戳
            vcode.src = "${pageContext.request.contextPath}/checkCodeServlet?time="+new Date().getTime();
        }
    </script>
</head>
<body>
<h3 style="text-align: center;">欢迎登录</h3>
<form action="${pageContext.request.contextPath}/login" method="post">
    <table width="100%" border="0" cellspacing="0"style="margin-top:15px ;margin-left:10%; margin-right:10%">
        <tr>
            <td style="text-align:right; padding-top:5px; width:25%">用户名：</td>
            <td style="text-align:left"><input name="username"type="text" class="textinput" /></td>
        </tr>
        <tr>
            <td style="text-align:right; padding-top:5px">密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
            <td style="text-align:left"><input name="password"type="password" class="textinput" /></td>
        </tr>

        <tr>
            <td style="text-align:right;"></td>
            <td style="text-align:left;">
                <div>
                    <label for="vcode" >验证码：</label>
                    <input type="text" name="verifycode" class="form-control" id="verifycode" placeholder="请输入验证码" style="width: 120px;"/>

                    <a href="javascript:refreshCode();">
                        <img src="${pageContext.request.contextPath}/checkCodeServlet" title="看不清点击刷新" id="vcode"/>
                    </a>
                </div>
            </td>
        </tr>

        <tr>
            <td></td>
            <td><button  type="submit">登录</button></td>
        </tr>
<%--        提示框--%>
        <tr>
            <td></td>
            <td style="padding-top:20px;margin-left:10%; margin-right:10%"><font color="#ff0000">${requestScope["login_msg"]}</font></td>
        </tr>
    </table>

</form>
</body>
</html>
